package com.sky.controller.user;

import com.sky.context.BaseContextStatus;
import com.sky.result.Result;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

@RestController
@Slf4j
@RequestMapping("/user/shop")
@Api(tags = "店铺操作")
public class UserShopController {

    @GetMapping("/status")
    public Result<Integer> getOperationStatus(){
        String name = Thread.currentThread().getName();
        System.out.println(name);
        Integer status = BaseContextStatus.getStatus();
        return Result.success(status);
    }
    @PutMapping("/{status}")
    public Result<Integer> setOperationStatus(@PathVariable Integer status){

        String name = Thread.currentThread().getName();
        System.out.println(name);
        BaseContextStatus.setStatus(status);
        return Result.success(status);
    }
}
